-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix supertab freezing the app #6965
base: main
Are you sure you want to change the base?
Conversation
Removes pointless conditions and the infinite, app-freezing while-loop.
When are you experiencing this infinite loop error? |
Whenever the main UI is not on screen, like when the app is starting up, or before logging in. (Also, it's not an "error"; the app just freezes forever until I force-quit it.) The loop runs forever because the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jamiebuilds-signal self-requested a review last month
Fine, I'll do it myself.
index = 0; | ||
} | ||
} | ||
const index = (focusedIndex + 1) % targets.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed shiftKey
handling because it's disabled for Ctrl+T as Ctrl+Shift+T is the shortcut for focusing the composer field. Ctrl+Shift+F6 would still be possible if you think users would suddenly start caring about that shortcut, since it's been broken for a long time without anyone noticing.
const index = (focusedIndex + 1) % targets.length; | |
const lastIndex = targets.length - 1; | |
let index; | |
if (focusedIndex < 0) { | |
index = shiftKey ? lastIndex : 0; | |
} else { | |
const increment = shiftKey ? lastIndex : 1; | |
index = (focusedIndex + increment) % targets.length; | |
} |
(focusedElement != null && target === focusedElement) || | ||
target.contains(focusedElement) | ||
) { | ||
if (target.contains(focusedElement)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target.contains(focusedElement)
makes the preceding condition pointless because .contains()
allows a null
parameter and considers elements to also contain themselves.
@@ -42,7 +42,7 @@ export function addGlobalKeyboardShortcuts(): void { | |||
return; | |||
} | |||
|
|||
// Super tab :) | |||
// Super tab :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signal Spirits haunt this codebase. Let the frown scare them away.
First time contributor checklist:
Contributor checklist:
main
branchnpm run ready
run passes successfully (more about tests here)Description
Removes pointless conditions and the infinite, app-freezing while-loop.